<!DOCTYPE html>
<html>

<head>



    <title>懂杯帝微信小程序 - 测试</title>
    <link href="style.css" rel="stylesheet" type="text/css" />
    <script src="https://cdn.staticfile.org/vue/3.0.5/vue.global.js"></script>
    <script src="https://cdn.staticfile.org/axios/0.18.0/axios.min.js"></script>
</head>

<body>

    <div id="mobile" class="guide_container">

        <button class="guide_btn" @click="openWeapp()">点击跳转小程序</button>
        {{a.data}}
    </div>


    <script>
        const App = Vue.createApp({
            setup() {
                const a = Vue.ref("");

                const openWeapp = () => {
                    location.href = a.value.data;
                    console.log("666");
                    console.log(a.value.data)
                }

                Vue.onMounted(() => {
                    axios
                        .get('https://dongbd.com/wp-json/wx_xcx/v1/qy')
                        .then(response => {
                            console.log(response.data);
                            a.value = response.data;
                        })
                        .catch(function (error) {
                            alert(error)
                        })
                })

                return {
                    a,
                    openWeapp,
                };
            },
        });
        App.mount("#mobile");
    </script>


</body>

</html>